package com.borrowed.book.coupon.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * @TableName s_coupon
 */
public class SCoupon implements Serializable {
    @TableId(type= IdType.AUTO)
    private Long id;

    @ApiModelProperty(value ="优惠券名称",example = "快递优惠券",dataType = "String",required = true)
    private String title;

    @ApiModelProperty(value ="图片地址",example = "/usr/image.jpg",dataType = "String",required = true)
    private String icon;

    @ApiModelProperty(value ="优惠券类型，字典：couponType",example = "1",dataType = "String",required = true)
    private String couponType;

    @ApiModelProperty(value ="发放开始时间",dataType = "Date")
    private Date startTime;

    @ApiModelProperty(value ="发放结束时间",dataType = "Date")
    private Date endTime;

    @ApiModelProperty(value ="时效：字典validType",example = "1",dataType = "String",required = true)
    private String validType;

    @ApiModelProperty(value ="自领取之日起有效天数（相对时效时必填）",dataType = "Integer",example = "30")
    private Integer validDays;

    @ApiModelProperty(value ="优惠券使用开始时间（绝对时效必填）",dataType = "Date")
    private Date validStartTime;

    @ApiModelProperty(value ="优惠券使用时效时间(绝对时效必填)",dataType = "Date")
    private Date validEndTime;

    @ApiModelProperty(value ="面值",dataType = "BigDecimal")
    private BigDecimal faceValue;

    private Date createTime;

    @ApiModelProperty(value ="配额",dataType = "Long")
    private Long quota;

    @ApiModelProperty(value ="已领取的优惠券数量",dataType = "Long")
    private Long takeCount;

    @ApiModelProperty(value ="已使用的优惠券数量",dataType = "Long")
    private Long usedCount;

    @ApiModelProperty(value ="优惠说明",dataType = "String")
    private String remark;
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 优惠券名称
     */
    public String getTitle() {
        return title;
    }

    /**
     * 优惠券名称
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 图片
     */
    public String getIcon() {
        return icon;
    }

    /**
     * 图片
     */
    public void setIcon(String icon) {
        this.icon = icon;
    }

    /**
     * 优惠券类型
     */
    public String getCouponType() {
        return couponType;
    }

    /**
     * 优惠券类型
     */
    public void setCouponType(String couponType) {
        this.couponType = couponType;
    }

    /**
     * 发放开始时间
     */
    public Date getStartTime() {
        return startTime;
    }

    /**
     * 发放开始时间
     */
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    /**
     * 发放结束时间
     */
    public Date getEndTime() {
        return endTime;
    }

    /**
     * 发放结束时间
     */
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    /**
     * 时效：字典validType
     */
    public String getValidType() {
        return validType;
    }

    /**
     * 时效：字典validType
     */
    public void setValidType(String validType) {
        this.validType = validType;
    }

    /**
     * 自领取之日起有效天数
     */
    public Integer getValidDays() {
        return validDays;
    }

    /**
     * 自领取之日起有效天数
     */
    public void setValidDays(Integer validDays) {
        this.validDays = validDays;
    }

    /**
     * 优惠券使用开始时间
     */
    public Date getValidStartTime() {
        return validStartTime;
    }

    /**
     * 优惠券使用开始时间
     */
    public void setValidStartTime(Date validStartTime) {
        this.validStartTime = validStartTime;
    }

    /**
     * 优惠券使用失效时间
     */
    public Date getValidEndTime() {
        return validEndTime;
    }

    /**
     * 优惠券使用失效时间
     */
    public void setValidEndTime(Date validEndTime) {
        this.validEndTime = validEndTime;
    }

    /**
     * 面值
     */
    public BigDecimal getFaceValue() {
        return faceValue;
    }

    /**
     * 面值
     */
    public void setFaceValue(BigDecimal faceValue) {
        this.faceValue = faceValue;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 配额：发券数量
     */
    public Long getQuota() {
        return quota;
    }

    /**
     * 配额：发券数量
     */
    public void setQuota(Long quota) {
        this.quota = quota;
    }

    /**
     * 已领取的优惠券数量
     */
    public Long getTakeCount() {
        return takeCount;
    }

    /**
     * 已领取的优惠券数量
     */
    public void setTakeCount(Long takeCount) {
        this.takeCount = takeCount;
    }

    /**
     * 已使用的优惠券数量
     */
    public Long getUsedCount() {
        return usedCount;
    }

    /**
     * 已使用的优惠券数量
     */
    public void setUsedCount(Long usedCount) {
        this.usedCount = usedCount;
    }

    /**
     * 优惠说明
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 优惠说明
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SCoupon other = (SCoupon) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()))
            && (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getValidType() == null ? other.getValidType() == null : this.getValidType().equals(other.getValidType()))
            && (this.getValidDays() == null ? other.getValidDays() == null : this.getValidDays().equals(other.getValidDays()))
            && (this.getValidStartTime() == null ? other.getValidStartTime() == null : this.getValidStartTime().equals(other.getValidStartTime()))
            && (this.getValidEndTime() == null ? other.getValidEndTime() == null : this.getValidEndTime().equals(other.getValidEndTime()))
            && (this.getFaceValue() == null ? other.getFaceValue() == null : this.getFaceValue().equals(other.getFaceValue()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getQuota() == null ? other.getQuota() == null : this.getQuota().equals(other.getQuota()))
            && (this.getTakeCount() == null ? other.getTakeCount() == null : this.getTakeCount().equals(other.getTakeCount()))
            && (this.getUsedCount() == null ? other.getUsedCount() == null : this.getUsedCount().equals(other.getUsedCount()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
        result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getValidType() == null) ? 0 : getValidType().hashCode());
        result = prime * result + ((getValidDays() == null) ? 0 : getValidDays().hashCode());
        result = prime * result + ((getValidStartTime() == null) ? 0 : getValidStartTime().hashCode());
        result = prime * result + ((getValidEndTime() == null) ? 0 : getValidEndTime().hashCode());
        result = prime * result + ((getFaceValue() == null) ? 0 : getFaceValue().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getQuota() == null) ? 0 : getQuota().hashCode());
        result = prime * result + ((getTakeCount() == null) ? 0 : getTakeCount().hashCode());
        result = prime * result + ((getUsedCount() == null) ? 0 : getUsedCount().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", icon=").append(icon);
        sb.append(", couponType=").append(couponType);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", validType=").append(validType);
        sb.append(", validDays=").append(validDays);
        sb.append(", validStartTime=").append(validStartTime);
        sb.append(", validEndTime=").append(validEndTime);
        sb.append(", faceValue=").append(faceValue);
        sb.append(", createTime=").append(createTime);
        sb.append(", quota=").append(quota);
        sb.append(", takeCount=").append(takeCount);
        sb.append(", usedCount=").append(usedCount);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}